'''
Created on 2009-4-17

@author: Administrator
'''
import unittest
from com.carnation.common.util.test import testTools


class Test(unittest.TestCase):
    def testCreate(self):
        test = testTools(__file__) 
        rsp_msg = test.requestAndRsp(1, 'Run For Test DataService.create', \
'''
DataService.create
    MOIData
        setModelId    "Model=112"
        setName    "pySchema"
        setParentId    null
        setDisplayName    "pySchema"
''', \
'''
MOIData
    getName    "pySchema"
    getModelId    "Model=112"
    getParentId    "Catalog=1"
    getDisplayName    "pySchema"
'''
)
        print rsp_msg
        print '\nDone'
        test.quit()

    def testDelete(self):
        test = testTools(__file__) 
        rsp_msg = test.requestAndRsp(2, 'Run For Test DataService.delete', \
'''
DataService.delete
    MOIData
        setId    "Schema=12"
''', \
'''
true
'''
)
        print rsp_msg
        rsp_msg = test.requestAndRsp(3, 'Run For Test DataService.delete', \
'''
DataService.delete
    String    "Schema=10"
''', \
'''true'''
)
        print rsp_msg
        print '\nDone'
        test.quit()

if __name__ == "__main__":
    unittest.main()

